package com.xxgc.eow.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.xxgc.eow.entity.Topiclibrarytype;
import com.xxgc.eow.result.Result;
import com.xxgc.eow.service.ITopicLibraryIndexVOService;
import com.xxgc.eow.service.ITopiclibraryService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author:yxh
 * @Date :2023/6/6 - 06 - 06 - 13:05
 */
@Tag(name = "题库与题目下标")
@RestController
@RequestMapping("/topicLibraryIndexVO")
public class TopicLibraryIndexVOController {

    @Resource
    private ITopicLibraryIndexVOService topicLibraryIndexVOService;

    @Resource
    private ITopiclibraryService topiclibraryService;

    /**
     * 查询所有题目下标以及题库
     * @return
     */
    @ApiOperationSupport(author = "yxh")
    @Operation(summary = "查询所有接口", description = "根据题库id与题目id查询")
    @SaIgnore
    @GetMapping("/getByChooseId")
    public Result findOne(Integer chooseId) {
        Integer topicLibraryId = topiclibraryService.getTopicLibraryIdByChooseId(chooseId);
        return Result.ok(topicLibraryIndexVOService.getOne(topicLibraryId,chooseId));
    }
}
